package star.trek.voyager.module.pojo.status_checker;

import java.util.ArrayList;

import star.trek.voyager.blueprint.status.Status;
public class StatusChecker implements Status{
	
	private String status = "not inited";
	
	private ArrayList<Status> modules = new ArrayList<Status>();
	
	public void addModule(Status statusAbleModule) {
		modules.add(statusAbleModule);
	}
	
	/**
	 * should be called after added all modules
	 */
	public void init(){
		StringBuilder sb = new StringBuilder();
		for(Status statusAbleModule:modules){
			sb.append(statusAbleModule.checkStatus()).append("\n");
		}
		status = sb.toString();
	}
	
	
	public String checkStatus() {
		return status;
	}
	
	public String toString(){
		return this.getClass().getName()+"-0.1.0.0";
	}
	
}
